package com.sh.data.engine.domain.authority.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sh.data.engine.domain.authority.model.domain.DataAuthDetailDomain;
import com.sh.data.engine.domain.authority.model.domain.DataAuthDomain;
import com.sh.data.engine.domain.authority.model.domain.ProjectTblDomain;
import com.sh.data.engine.domain.authority.model.domain.UserAuthTblThemeDomain;
import com.sh.data.engine.repository.dao.authority.entity.ProjectTblEntity;

import java.util.List;
import java.util.Map;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/26 9:25
 */
public interface DataAuthService {

    IPage<DataAuthDomain> getDataAuth(String userName, Integer pageNum, Integer pageSize);

//    List<DataAuthDetailDomain> getDataAuthSec(Long userId);
    List<DataAuthDetailDomain> getDataAuthSec(String userId);

//    List<UserAuthTblThemeDomain> getDataAuthTblList(Long projectId, Long userId);
    List<UserAuthTblThemeDomain> getDataAuthTblList(Long projectId, String userId);

    Boolean saveDataAuth(ProjectTblDomain projectTblDomain);

    /**
     * @description : 查询某个用户是否有某个表的数据权限 0-只读 1—读写 2-无读写权限
     * @author : tinglan.ys
     * @date : 2022/3/4
     */
//    String getTblAuth(Long projectId, Long userId, Long tblId);
    String getTblAuth(Long projectId, String userId, Long tblId);

//    Map<Long, String> getTblAuthMap(Long projectId, Long userId, List<Long> tblId);
    Map<Long, String> getTblAuthMap(Long projectId, String userId, List<Long> tblId);

    /**
     * @description : 查询某个用户的某个空间下某些表权限
     * @author : tinglan.ys
     * @date : 2022/8/22
     */
//    List<ProjectTblEntity> getSomeTblAuth(Long projectId, Long userId, List<Long> tblIds);
    List<ProjectTblEntity> getSomeTblAuth(Long projectId, String userId, List<Long> tblIds);
}
